// run: $exec < input
#include <cstdio>
#include <cstring>

const int MAXN = 100005;
const long long INF = 1000000000000;

long long width [MAXN], height [MAXN];
int N;
int prev [MAXN], next [MAXN];
long long ans [MAXN], total = 0;

void init()
{
	memset(prev, 0, sizeof(prev));
	memset(next, 0, sizeof(next));
	memset(ans, 0, sizeof(ans));
	memset(width, 0, sizeof(width));
	memset(height, 0, sizeof(height));
	total = 0;
}

int main ()
{
	while (scanf ("%d", &N) != EOF) {
		init();
		height [0] = height [N + 1] = INF;

		int ind = 1;

		for (int i = 1; i <= N; i++) {
			scanf ("%lld %lld", height + i, width + i);
			prev [i] = i - 1, next [i] = i + 1;

			if (height [i] < height [ind])
				ind = i;
		}

		while (height [ind] < INF) {
			ans [ind] = total + width [ind];
			next [prev [ind]] = next [ind], prev [next [ind]] = prev [ind];
			if (height [prev [ind]] < height [next [ind]]) {
				total += width [ind] * (height [prev [ind]] - height [ind]);
				width [prev [ind]] += width [ind];
				ind = prev [ind];

				while (ind > 0 && height [prev [ind]] < height [ind])
					ind = prev [ind];
			} else {
				total += width [ind] * (height [next [ind]] - height [ind]);
				width [next [ind]] += width [ind];
				ind = next [ind];

				while (ind <= N && height [next [ind]] < height [ind])
					ind = next [ind];
			}
		}

		printf("%lld", ans[1]);
		for (int i = 2; i <= N; i++) printf(" %lld", ans [i]);
		printf("\n");
	}
}

